<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/style1.css"/>
	</head>
	<body>
		
		<div class="c">
			<h2>京东秒杀</h2>
			<h4>18:00 点场 倒计时</h4>
		<span id="aaa">00</span>
		<span id="bbb">00</span>
		<span id="ccc">00</span>
		</div>
		

		
	<script type="text/javascript">
		setInterval(function(){
			//获取当前时间
			var time=new Date();
			//定义结束时间
			var times=new Date('2019/9/3 21:00:00');
			//剩余的时间
			var tim=times.getTime()-time.getTime();
			
			if(tim>0){
				var c=Math.floor(tim/1000/60/60)
				var a=Math.floor(tim/1000/60%60)
				var o=Math.floor(tim/1000%60)
				
				if(c<10){c='0'+c}else{c=c}
				if(a<10){a='0'+a}else{a=a}
				if(o<10){o='0'+o}else{o=o}
				
				document.querySelector("#aaa").innerHTML = c
				document.querySelector("#bbb").innerHTML = a
				document.querySelector("#ccc").innerHTML = o
			}else{
				alert("结束了")
			}
		},1000);
	</script>
		
	</body>
</html>
